//
//  UIBarButtonItem + Extension.swift
//  WHYWeibo-1.0
//
//  Created by 王洪运 on 15/12/1.
//  Copyright © 2015年 王洪运. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    
    convenience init(imageName: String, target: AnyObject?, actionName: String?) {
        let button = UIButton(imageName: imageName)
        
        if let actionN = actionName {
            button.addTarget(target, action: Selector(actionN), forControlEvents: .TouchUpInside)
        }
        
        self.init(customView: button)
    }
    
}
